<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<?php session_start(); 
	if(isset($_SESSION['user']['Nom'])) {include 'includes/bandeau_sup.php';}
?>
<html>
	<head>
		<title>Compétences | Acceuil</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel='stylesheet' href='includes/style.css' />
		<link href='http://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700' rel='stylesheet' type='text/css'>
		<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro' rel='stylesheet' type='text/css'>
		<script>
		function confirm_delete(){
			if(!confirm('Voulez-vous supprimer cet utilisateur ?')) return false;
		}
		</script>
	</head>
	<body>
		<?php if(!isset($_SESSION['user']['Nom'])): ?>
		<header id="h2">
			<h1>Gestion de la table des compétences</h1>
		</header>
		<?php else: ?>
		<header>
			<h1>Gestion de la table des compétences</h1>
		</header>
		<?php endif ?>
		<div id='bloc_page'>
			<section>
				<article style='text-align:center;border-bottom:1px solid black;'><?php if (isset($_SESSION['user']['message'])) {echo "<img src='/img/error.png' /> - ".$_SESSION['user']['message']; unset($_SESSION['user']['message']);} ?></article>
				<?php if(!isset($_SESSION['user']['FK_statut'])): ?>
				<article style="text-align:center;">
					<h2>Connexion</h2>
					<form method="POST" action="connect.php" name="form_con">
						<p>Nom d'utilisateur &rarr; <input type="text" name="username" /></p>
						<p>Mot de passe &rarr; <input type="password" name="password" /></p>
						<input type="submit" name="connect" />
					</form>
					<p><a href="creation_utilisateur.php">Création de compte</a></p>
				</article>
				<?php elseif ($_SESSION['user']['FK_statut'] == 2): ?>
					<?php 
					if ($_SESSION['user']['valide']==1)
						{include "../tpl/indexEleve.php";}
					else {include "../tpl/nonActivated.php";}
					?>
				<?php elseif ($_SESSION['user']['FK_statut'] == 1): ?>
					<?php if ($_SESSION['user']['valide']==1)
						{include "../tpl/indexProf.php";}
					else {include "../tpl/nonActivated.php";} ?>
				<?php elseif ($_SESSION['user']['FK_statut'] == 3): ?>
					<?php include "../tpl/indexAdmin.php" ?>
				<?php endif ?>

			</section>
		</div>
		<?php include "includes/footer.php"; ?>
	</body>
</html>